package com.zhang.observer;

public class Client {
    public static void main(String[] args) {
        //1. 创建公众号
        SubscriptionSubject subject = new SubscriptionSubject();

        //2.订阅公众号
        subject.attach(new WeiXinUser("孙悟空"));
        subject.attach(new WeiXinUser("唐僧"));
        subject.attach(new WeiXinUser("沙和尚"));
        subject.attach(new WeiXinUser("猪八戒"));

        //3.公众号更新，发出消息给订阅者
        subject.notify("我的专栏更新了");

    }
}
